<template>
	<view class="list-layout flex-row" @click="onClick()">
		<image :src="item.imageUrl.url" mode="aspectFill" class="leading"></image>
		<view class="trailing flex-column">
			<text class="name"> {{item.name}} </text>
			<view class="middle"></view>
			<view class="auth"> {{item.auth}} </view>
			<view class="bottom flex-row">
				<view class="price">{{item.price}}</view>
				<view-like-more :view="false" :like_count="item.like_count"></view-like-more>
			</view>
		</view>
	</view>
</template>

<script setup>
	const props = defineProps({
		item: {
			type: Object,
			default: null
		}
	})

	function onClick() {
		uni.navigateTo({
			url: '/pages_xuexi/detail/jibenxinxi?id=' + props.item._id
		})
	}
</script>

<style lang="scss" scoped>
	.list-layout {
		background-color: white;
		margin-top: 10rpx;
		padding: 28rpx 40rpx;

		.leading {
			height: 200rpx;
			width: 200rpx;
		}

		.trailing {
			margin-left: 20rpx;
			flex: 1;

			.name {
				font-size: 30rpx;
				@include maxLines(2)
			}

			.middle {
				flex: 1;
			}

			.auth {
				font-size: 24rpx;
				color: $me-color-gray-6;
			}

			.bottom {
				.price {
					flex: 1;
					font-size: 36rpx;
					color: $me-color-red-1;
				}
			}
		}
	}
</style>